package seap.actions;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;

import seap.bo.TalhaoBO;


public class TalhaoAction extends DispatchAction {
	
	TalhaoBO talhao = new TalhaoBO();
	
    private Log logger = LogFactory.getLog(this.getClass());
	
	public ActionForward cadastrar(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    	logger.debug("Cadastrar - Talhao");
    	
    	String nome = (String) request.getParameter("nome_talhao");
    	String localizacao = (String) request.getParameter("localizacao_talhao");
    	String result = talhao.add(nome, localizacao);
        
        return mapping.findForward(result);
    }
	
	public ActionForward remover(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    	logger.debug("");
        
        return null;
    }
	
	public ActionForward buscar(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    	logger.debug("");
        
        return null;
    }
}
